<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>首页</title>
</head>
<body>
<h1 th:text="${msg}"></h1>

<div shiro:authenticated>
    <p>欢迎, <span shiro:principal></span>! <a href="/logout">退出</a></p>
</div>
<div shiro:notAuthenticated>
    <a href="/login">请登录</a>
</div>

<hr>
<div shiro:hasRole="manager">
    <p><a th:href="@{/admin/dashboard}">进入管理员后台</a> (需要 manager 角色)</p>
</div>
<div shiro:hasPermission="userAdd">
    <p><a href="addUser.html">添加用户</a> (需要 userAdd 权限)</p>
</div>
</body>
</html>